import React, { useState } from 'react';
import { Text, View, Image} from 'react-native';
import { scaleSizeH, scaleSizeW, setSpText } from '../../util/ScreenUtil.js'
import ReactBotton from "../Widget/ReactBotton"
import Icon from "../../assets/fonts/iconfont.js";
import {url} from '../../util'
export default function LinkText(props) {
    const SELECTED = "#fdad2b"
    const NO_SELECTED = "#e4e4e4"
    let { children, BoxStyle ,data} = props
    let posterurl=url+data.poster[0]
    let actor=""
    let actorAry=data.actor
        actorAry.forEach((item,index)=>{
            actorAry[index]= item.split(" ")[0]
            if (index==(actorAry.length-1)) {
                actor+=actorAry[index]
            }else{
                actor+=actorAry[index]+"/"
            }
        })
    BoxStyle = {
        width:scaleSizeW(750),
        height:scaleSizeH(298),
        borderBottomWidth:1,
        borderBottomColor:"#eee",
        
        ...BoxStyle
    }
    return (
        <View style={BoxStyle}>
            <View style={{flexDirection:"row",height:scaleSizeH(237),width:scaleSizeW(690),justifyContent:"space-between",marginLeft:scaleSizeW(32),}}>
                <Image
                source={{uri:posterurl}}
                style={{width:scaleSizeW(169),height:scaleSizeH(235),marginTop: scaleSizeH(30)}}
                />
                <View style={{width:scaleSizeW(320),marginTop: scaleSizeH(30),flexWrap:"nowrap"}}>
                    <Text style={{fontSize:setSpText(34),fontWeight:"bold"}}>{data.cname}</Text>
                    <Text style={{fontSize:setSpText(24),color:"#909090"}}>导演：{data.director}</Text>
                    <Text style={{fontSize:setSpText(24),color:"#909090"}}>演员：{actor}</Text>
                </View>
                <View style={{marginTop: scaleSizeH(69),alignItems:"center",width:scaleSizeW(144)}}>
                <Text style={{fontSize:setSpText(20),marginBottom:scaleSizeH(20),color:"#ffad2e"}}>{data.number}人想看</Text>
                <ReactBotton
                buttonStyle={{width:scaleSizeW(124),height:scaleSizeH(60),borderWidth: 1, borderColor: "#ffad2e",backgroundColor:"#fff"}}
                buttonText={{fontSize:setSpText(28),color:"#ffad2e"}}
                >想看</ReactBotton>
                </View>
            </View>
        </View>
    );
}